package variable;

import java.util.Arrays;

public class CompoundInterest {
    public static void main(String[] args) {
        final double STARTRATE = 10;
        final int NYEARS = 10;
        final int NRATES = 6;
        double[] interestRate = new double[NRATES];
        for (int i =0;i<NRATES;i++){
            interestRate[i] = (STARTRATE+i)/100.0;
        }

        double[][] balances = new double[NYEARS][NRATES];

        for (int i =0;i<NRATES;i++){
            balances[0][i] = 10000;
        }

        for (int i =1;i<NYEARS;i++){
            for (int j=0;j<NRATES;j++){
                balances[i][j] = balances[i-1][j] * (1+interestRate[j]);
            }
        }
        for (double[] row:balances){
            for (double ele:row){
                System.out.printf("%10.2f",ele);
            }
            System.out.println();
        }
    }
}
